<extend name="Public/common" />
<block name="body">
<div class="page">
  <div class="fixed-bar">
    <div class="item-title">
      <h3>微信菜单管理</h3>
      <ul class="tab-base">
        <li><a href="JavaScript:void(0);" class="current"><span>列表</span></a></li>
        <li><a href="{:U('add')}" ><span>新增</span></a></li>
        <li><a href="{:U('menu_create')}" ><span>发布微信菜单</span></a></li>
        <li><a href="{:U('menu_delete')}" ><span>删除微信菜单</span></a></li>
      </ul>
    </div>
  </div>
  <div class="fixed-empty"></div>
   <table class="table tb-type2" id="prompt">
    <tbody>
      <tr class="space odd">
        <th class="nobg" colspan="12"><div class="title"><h5>操作提示</h5><span class="arrow"></span></div></th>
      </tr>
      <tr>
        <td>
        <ul>
            <li>自定义菜单最多包括3个一级菜单，每个一级菜单最多包含5个二级菜单。</li>
          <li>添加修改完 一定要点发布 才会到微信上显示</li>
          </ul></td>
      </tr>
    </tbody>
  </table>
  <form method="post" id="form1">
    <table class="table tb-type2">
      <thead>
        <tr class="thead">
          <th></th>
          <th>排序</th>
          <th>名称</th>
          <th class="w108 align-center">操作</th>
        </tr>
      </thead>
      <tbody>
        <notempty name="list">
        <volist name="list" id="vo">
        <tr class="hover edit">
          <td class="w48"><input type="checkbox" name='id[]' value="{$vo['menu_id']}" class="checkitem">
            <img fieldid="{$vo['menu_id']}" status="none" nc_type="flex" src="__IMG__/tv-item.gif">
		  </td>
          <td class="w48 sort"><span title="可编辑" ajax_branch="menu_sort" datatype="number" fieldid="{$vo['menu_id']}" fieldname="sort" nc_type="inline_edit" class="editable ">{$vo['sort']}</span></td>
          <td class="name">
            {$vo['menu_title']}
          <a class="btn-add-nofloat marginleft" href="{:U('add?parent_id='.$vo['menu_id'])}"><span>新增下级</span></a>
          </td>
          <td class="align-center">
            <a href="{:U('edit?id='.$vo['menu_id'])}">编辑</a> |
          	<a href="javascript:if(confirm('删除该分类将会同时删除该分类的所有下级分类，您确定要删除吗?'))window.location = '{:U('delete?id='.$vo['menu_id'])}';">删除</a>
          </td>	
        </tr>
        <notempty name="vo.child">
          <volist name="vo.child" id="v">
            <tr class="hover edit row1">
              <td class="w48"><input type="checkbox" name='id[]' value="{$v['menu_id']}" class="checkitem"><img src="__IMG__/tv-item.gif" nc_type="flex" status="none" fieldid="{$v['menu_id']}"></td>
              <td class="w48 sort">
                <span title="可编辑" ajax_branch="menu_sort" datatype="number" fieldid="{$v['menu_id']}" fieldname="sort" nc_type="inline_edit" class="editable ">{$v['sort']}</span>
              </td>
              <td class="name"><img src="__IMG__/tv-expandable1.gif" nc_type="flex" status="none" fieldid="{$v['menu_id']}">{$v['menu_title']}</td>
              <td class="align-center">
                <a href="{:U('edit?id='.$v['menu_id'])}">编辑</a> |
                <a href="javascript:if(confirm('删除该分类将会同时删除该分类的所有下级分类，您确定要删除吗?'))window.location = '{:U('delete?id='.$v['menu_id'])}';">删除</a>
              </td>
            </tr>
          </volist>
        </notempty>
        </volist>
        <else />
        <tr class="no_data">
          <td colspan="10">没有符合条件的记录</td>
        </tr>
        </notempty>
      </tbody>
      <tfoot>
        <tr class="tfoot">
          <notempty name="list">
          <td><input type="checkbox" class="checkall" id="checkall_2"></td>
          <td id="batchAction" colspan="15"><span class="all_checkbox">
            <label for="checkall_2">全选</label>
            </span>&nbsp;&nbsp;<a href="JavaScript:void(0);" class="btn" onclick="if(confirm('删除该分类将会同时删除该分类的所有下级分类，您确定要删除吗?')){$('#form1').submit();}"><span>删除</span></a>
            </td>
          <else />  
          <td colspan="15"></td>
         </notempty>   
        </tr>
      </tfoot>
    </table>
  </form>
</div>
<script type="text/javascript" src="__JS__/jquery.edit.js" charset="utf-8"></script> 
<script type="text/javascript" src="__JS__/jquery.goods_category.js" charset="utf-8"></script> 
</block>